package com.health.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.health.dao.CheckItemMapper;
import com.health.pojo.CheckItem;
import com.health.service.CheckItemService;
import com.health.vo.PageResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CheckItemServiceImpl implements CheckItemService {
    @Resource
    private CheckItemMapper checkItemMapper;


    @Override
    public PageResult<CheckItem> findPage(Integer pageNow, Integer pageSize, String query) {
        //引入分页插件
        PageHelper.startPage(pageNow,pageSize);
        Page<CheckItem> page=checkItemMapper.findByQuery(query);

        return new PageResult<>(page.getTotal(),page.getResult());
    }
}
